import pygame
from game_items import *
class HudPanel(object):
    """指示器面板类"""
    margin = 10                                                         # 精灵之间的间距
    white = (255, 255, 255)                                             # 白色
    gray = (64, 64, 64)                                                 # 灰色

    def __init__(self,display_group):
        """构造方法
        :param display_group:面板中的精灵要添加到的显示精灵组
        """
        #游戏属性
        self.score = 0                                                  #游戏得分
        self.lives_count = 3                                            #生命计数
        self.level = 1                                                  #关卡等级
        self.best_score = 0                                             #最好成绩

        #创建图像精灵
        #状态精灵
        self.status_sprite = StatusButton(("pause.png", "resume.png"), display_group)
        self.status_sprite.rect.topleft = (self.margin, self.margin)

        #炸弹精灵
        self.bomb_sprite = GameSprite("bomb.png", 0, display_group)
        self.bomb_sprite.rect.x = self.margin
        self.bomb_sprite.rect.bottom = SCREEN_RECT.bottom - self.margin

        #生命计数精灵
        self.lives_sprite = GameSprite("life.png", 0, display_group)
        self.lives_sprite.rect.right = SCREEN_RECT.right - self.margin
        self.lives_sprite.rect.bottom = SCREEN_RECT.bottom - self.margin
